home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / utils / less.arc / LESS.DOC next >
Text File  |  1985-11-20  |  13KB  |  293 lines

  1.         
  2.         
  3.         
  4.         
  5.         
  6.         
  7.         LESS - opposite of more
  8.         
  9.         less [-cdepstwmMqQuU] [-hn] [-b[fp]n] [-xn] [+cmd] [name(s)]
  10.         
  11.         LESS is a program similar to  MORE, but  which  allows
  12.         backwards  movement in the file as well as forward movement.
  13.         Also, LESS does not have  to  read  the  entire  input  file
  14.         before starting, so with large input files it starts up fas-
  15.         ter than text editors like vix.
  16.         
  17.              Commands are based on both more and vi.   Commands  may
  18.         be  preceeded  by a decimal number, called N in the descrip-
  19.         tions below.  The number is used by some commands, as  indi-
  20.         cated.
  21.         
  22.         As of this posting, LESS works a) from the desktop and b) in
  23.         the Mark Williams shell.  It  hasn't been tested with the
  24.         Breckmeyer or any other shells.  All references to environment
  25.         variables in the rest of this doc refer to Msh environment
  26.         variables.  Shell escapes and invocations of the editor also
  27.         work only in the Msh.
  28.         
  29.         
  30.         h    Help: display a summary of these commands.  If you for-
  31.              get all the other commands, remember this one.
  32.         
  33.         
  34.         SPACEScroll forward N lines, default one screen.   If  N  is
  35.              more  than  the  screen  size,  only  one  screenful is
  36.              displayed.
  37.         
  38.         
  39.         f    Same as SPACE.
  40.         
  41.         
  42.         b    Scroll backward N lines, default one screen.  If  N  is
  43.              more  than  the  screen  size,  only  one  screenful is
  44.              displayed.
  45.         
  46.         
  47.         RETURNScroll forward N lines, default 1.  If N is more  than
  48.              the screen size, the entire N lines are displayed.
  49.         
  50.         
  51.         e    Same as RETURN.
  52.         
  53.         
  54.         j    Also the same as RETURN.
  55.         
  56.         
  57.         y    Scroll backward N lines, default 1.  If N is more  than
  58.              the screen size, the entire N lines are displayed.
  59.         
  60.         k    Same as y.
  61.         
  62.         
  63.         d    Scroll forward N lines, default 10.  If N is specified,
  64.              it becomes the new default for all d and u commands.
  65.         
  66.         
  67.         u    Scroll backward N lines, default 10.  If  N  is  speci-
  68.              fied,  it  becomes the new default for all d and u com-
  69.              mands.
  70.         
  71.         
  72.         r    Repaint the screen.
  73.         
  74.         
  75.         R    Repaint the  screen,  discarding  any  buffered  input.
  76.              Useful  if  the  file  is  changing  while  it is being
  77.              viewed.
  78.         
  79.         
  80.         g    Go to line N in  the  file,  default  1  (beginning  of
  81.              file).  (Warning: this may be slow if N is large.)
  82.         
  83.         
  84.         G    Go to line N in the file, default the end of the  file.
  85.              (Warning:  this  may  be slow if standard input, rather
  86.              than a file, is being read.)
  87.         
  88.         
  89.         p    Go to a position N percent into the file.  N should  be
  90.              between 0 and 100.  (This is possible if standard input
  91.              is being read, but only if LESS has already read to the
  92.              end  of  the  file.   It is always fast, but not always
  93.              useful.)
  94.         
  95.         
  96.         %    Same as p.
  97.         
  98.         
  99.         m    Followed by any lowercase  letter,  marks  the  current
  100.              position with that letter.
  101.         
  102.         
  103.         '    Followed by any lowercase letter, returns to the  posi-
  104.              tion which was previously marked with that letter.  All
  105.              marks are lost when a new file is examined.
  106.         
  107.         
  108.         /pattern
  109.              Search forward in the file for the  N-th  occurence  of
  110.              the  pattern.  N defaults to 1.  The pattern is a regu-
  111.              lar expression (well, it works most of the time..).  
  112.              The search starts at  the  second  line displayed (but see 
  113.              the -t option, which changes this).
  114.         
  115.         
  116.         ?pattern
  117.              Search backward in the file for the N-th  occurence  of
  118.              the pattern.  The search starts at the line immediately
  119.              before the top line displayed.
  120.         
  121.         
  122.         n    Repeat previous search, for N-th occurence of the  last
  123.              pattern.
  124.         
  125.         
  126.         E    Examine a new file.  If the filename  is  missing,  the
  127.              "current"  file  (see  the N and P commands below) from
  128.              the list of files in the command line is re-examined.
  129.         
  130.         
  131.         N    Examine the next file (from the list of files given  in
  132.              the  command line).  If a number N is specified (not to
  133.              be confused with the command N), the N-th next file  is
  134.              examined.
  135.         
  136.         
  137.         P    Examine the previous file.  If a number N is specified,
  138.              the N-th previous file is examined.
  139.         
  140.         
  141.         =    Prints the name of the file being viewed and  the  byte
  142.              offset  of  the bottom line being displayed.  If possi-
  143.              ble, it also prints the length of the file and the per-
  144.              cent of the file above the last displayed line.
  145.         
  146.         
  147.         -    Followed by one of the command line option letters (see
  148.              below), this will toggle the setting of that option and
  149.              print a message describing the new setting.
  150.         
  151.         
  152.         V    Prints the version number of LESS being run.
  153.         
  154.         
  155.         q    Exits LESS.
  156.         
  157.              The following two commands at present work only with
  158.         the 'msh' of  Mark Willaims C (when LESS is run from  the
  159.         desktop, a  'Shell not found'  message is printed out.  A
  160.         fix for non-shell environments is in the offing).
  161.         
  162.         
  163.         v    Invokes an  editor  to  edit  the  current  file  being
  164.              viewed.  The editor is taken from the environment vari-
  165.              able EDITOR, or defaults to "vi".
  166.         
  167.         
  168.         ! shell-command
  169.              Invokes a shell to run the shell-command given.
  170.         
  171.         
  172.         Command line options are described below.  Options are  also
  173.         taken  from  the environment variable "LESS".  (The environ-
  174.         ment variable is parsed before the command line, so  command
  175.         line   options   override  the  LESS  environment  variable.
  176.         Options may be changed while LESS is  running  via  the  "-"
  177.         command.)  For example, if you like more-style prompting, to
  178.         avoid typing "less -pm ..." each time LESS  is  invoked,  you
  179.         might tell Msh (the Mark Williams shell):
  180.         
  181.         setenv LESS=-pm
  182.         
  183.         -s   The -s  flag  causes  consecutive  blank  lines  to  be
  184.              squeezed into a single blank line.  This is useful when
  185.              viewing nroff output.
  186.         
  187.         -t   Normally, forward searches start  just  after  the  top
  188.              displayed line (that is, at the second displayed line).
  189.              Thus forward searches include the  currently  displayed
  190.              screen.   The  -t  command  line  option causes forward
  191.              searches to start just after the bottom line displayed,
  192.              thus skipping the currently displayed screen.
  193.         
  194.         -m   The  -m  command line  option causes LESS to prompt 
  195.              less verbosely like more, printing the file name and 
  196.              percent into the file, or just with a colon.
  197.         
  198.         -M   The -M command line option causes LESS to  prompt  even
  199.              more verbosely than more (this is the default).
  200.         
  201.         -q   Normally, if an attempt is made to scroll past the  end
  202.              of  the  file  or before the beginning of the file, the
  203.              terminal bell is rung to indicate this  fact.   The  -q
  204.              command  line option tells LESS not to ring the bell at
  205.